public class Test {
    public static void main(String[] args) {
        //初始化所用数组
        int[]array={23,34,12,5,6,8,2,89};

        //堆的初始化
        MyPriorityQueue myPriorityQueueMax=new MyPriorityQueue();
        myPriorityQueueMax.init(array);

        //创建大根堆
        myPriorityQueueMax.createMaxHeap();
        myPriorityQueueMax.display();
        System.out.println("********************************");

        //对堆进行降序排序
        myPriorityQueueMax.heapSortReverse();
        myPriorityQueueMax.display();
        System.out.println("********************************");

        //堆的初始化
        MyPriorityQueue myPriorityQueueMin=new MyPriorityQueue();
        myPriorityQueueMin.init(array);

        //创建小根堆
        myPriorityQueueMin.createMinHeap();
        myPriorityQueueMin.display();
        System.out.println("********************************");

        //对堆进行升序排序
        myPriorityQueueMin.heapSort();
        myPriorityQueueMin.display();

    }
}

